package com.ruleengine.task.impl;

import java.util.ArrayList;
import java.util.List;

import com.ruleengine.task.ITask;
import com.ruleengine.task.TaskType;
import com.ruleengine.task.condition.ICondition;
import com.ruleengine.task.handler.IExceptionHandler;

public class ComplexTask extends BaseTask {
    private ICondition condition;
    private List<ITask> subTasks = new  ArrayList<ITask>();
    private IExceptionHandler exceptions = null;
    
    public ComplexTask(TaskType taskType) {
        super(taskType);
        // TODO Auto-generated constructor stub
    }

    public final void addSubTask(ITask task) {
        // TODO Auto-generated method stub
        subTasks.add(task);
    }

    public final List<ITask> getSubTasks() {
        // TODO Auto-generated method stub
        return subTasks;
    }

    public final void setSubTasks(List<ITask> subTasks) {
        // TODO Auto-generated method stub
        this.subTasks = subTasks;
    }

    public ITask getSubTask(int cursor) {
        // TODO Auto-generated method stub
        return subTasks.get(cursor);
    }

    public ICondition getCondition() {
        // TODO Auto-generated method stub
        return condition;
    }

    public void setCondition(ICondition condition) {
        // TODO Auto-generated method stub
        this.condition = condition;
    }

    public IExceptionHandler getExceptionHandler() {
        // TODO Auto-generated method stub
        return exceptions;
    }

    public void setExceptionHandler(IExceptionHandler exceptions) {
        // TODO Auto-generated method stub
        this.exceptions = exceptions;
    }
}
